public class Test2 {
    public static int add(int a,int b){
        return a+b;

    }
    public static void fun(){
        System.out.println("黄子健");
    }
    public static void main1(String[] args) {
        int a = 10;
        int b = 20;
        int ret = add(a,b);
        System.out.println(ret);
        fun();
    }

    public static int fac(int n){
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret *= i;
        }
        return ret;
    }
    public static int facSum(int k){
        int sum = 0;
        for (int i = 1; i <=k ; i++) {
            sum += fac(i);
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(facSum(5));
    }
}
